#include <iostream>
#include <fstream>
#include <cstdlib>
#include <cstring>
#include "param.h"
#include "legoland.h"
#include "frequency.h"
#include "kmeans.h"
#include "createREF.h"
#include "analyzeREADS.h"

using namespace std;

bool print_intro(int & r);

int main()      //for testing
{
    int i=0;

    while(i!=3)
    {
        print_intro(i);
        if(i==1)
        {
            CreateREF * c=new CreateREF();
            delete c;
            return 0;
        }
        else if (i==2)
        {
            analyzeREADS * a=new analyzeREADS();
            a->generate_output_files();
            delete a;
        }
    }
}





/*************************************************************************
* print_intro - prints welcome and first options for user
*   parameters:
*       -r: option selected by user.
*   return: true
**************************************************************************/
bool print_intro(int & r)
{
    bool loop=true;
    system("CLS");
    cout << "Welcome to DISCO v1.0!" << endl;
    while(loop)
    {
        cout << "Would you like to:\n";
        cout << "1 -> Create a new reference library" << endl;
        cout << "2 -> Analyze reads using an existing library" << endl;
        cout << "3 -> Quit" << endl;
        cout << "Enter choice 1 or 2 or 3: ";
        cin >> r;
        if( (r==1) || (r==2) || (r==3) ) loop=false;
        else cout << "That is not a valid choice. Try again.\n";
    }
    return true;
}


/*
int main__real()
{
    int i,j;
    Param * p;
    p=new Param();
    int num_coordinates;
    kmeans * clusters;
    int kum=100;            //just a test value

    //if new reference set has to be created


    //else run
 //   p->load_taxa();               //create taxa look up table
    legoland ** l=new legoland * [p->k_max-p->k_min+1];
    for(i=p->k_min; i<=p->k_max; i++)
    {
        l[i]=new legoland();

        for(j=0; j<p->num_reference_sp; j++)
        {
            centroid * plot=NULL;
            coordinates * data=NULL;
            Profile * profile=new Profile(i,p->r,p->gc_dim1_file,p->gc_dim2_file);
            num_coordinates=profile->get_coordinates_genome(p->reference_set,j,data);
            clusters=new kmeans(num_coordinates, data, kum);
            clusters->execute(plot);
//            l[i]->add(j,plot);                                                                                                  //problem. vector to array.
        }

    }

}
*/
